//
//  SearchTagCollectionViewCell.swift
//  APP
//
//  Created by gy on 2023/8/8.
//

import UIKit

class SearchTagCollectionViewCell: UICollectionViewCell {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        configUI()
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        
        DispatchQueue.main.async {
            self.backView.layerCornerRadius(5)
        }
    }
    func setTag(tag: String) {
        tagLabel.text = tag
    }
    
    // MARK: - configUI
    func configUI() {
        
        contentView.addSubview(backView)
        backView.addSubview(tagLabel)
        
        backView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        tagLabel.snp.makeConstraints { make in
            make.center.equalToSuperview()
        }
        
    }
    private lazy var backView: UIView = {
        let backView = UIView()
        backView.backgroundColor = UIColor.hex(hexString: "FAFAFA")
        return backView
    }()
    private lazy var tagLabel: UILabel = {
        let tagLabel = UILabel()
        tagLabel.font = kSetPingFangMedium(14)
        tagLabel.textColor = .app_black
        tagLabel.textAlignment = .center
        return tagLabel
    }()
    
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
